<div ng-controller="AuthorController">
	<h1>Authors</h1>
	<p>Management of all authors.</p>
	<p class="delimiter"></p>
	<h2>Create a new author</h2>
	<form id="authorForm" name="authorForm">
		<label class="small">First name:</label>&nbsp;&nbsp;<input id="firstname" size="25" ng-model="currentAuthor.firstname" required /><br/>
		<label class="small">Last name:</label>&nbsp;&nbsp;<input id="lastname" size="25" ng-model="currentAuthor.lastname" required /><br/>
		<label class="small">Username:</label>&nbsp;&nbsp;<input id="login" size="20" ng-model="currentAuthor.login" required /><br/>
		<label class="small">Password:</label>&nbsp;&nbsp;<input id="password" size="20" ng-model="currentAuthor.password" type="password" required />
		<p class="delimiter"></p>
		<button id="saveAuthor" ng-click="save()" ng-disabled="authorForm.$invalid">Save this author</button><button id="cancel" ng-click="cancel()">Cancel</button>
	</form>
	<p class="delimiter"></p>
	<h2>Editing and deleting of saved authors</h2>
	<table id="table" border="1">
		<thead>
			<tr>
				<th>Id</th>
				<th>First name</th>
				<th>Last name</th>
				<th>Username</th>
				<th>Password</th>
				<th>Edit</th>
				<th>Delete</th>
			</tr>
		</thead>
		<tbody>
			<tr ng-repeat="author in authors">
				<td>{{author.id}}</td>
				<td>{{author.firstname}}</td>
				<td>{{author.lastname}}</td>
				<td>{{author.login}}</td>
				<td>{{author.passwort}}</td>
				<td><button id="edit" ng-click="edit(author)">Edit author</button></td>
				<td><button id="delete" ng-click="remove($index, author.id)">Delete author</button></td>
			</tr>
		</tbody>
	</div>